package Morning;

import java.util.Iterator;
import java.util.TreeSet;

public class TreeSetGompareto_two {


    public static void main(String[] args) {

        TreeSet<Students> stu = new TreeSet<>();






        stu.add(new Students("张三",100,89));
        stu.add(new Students("李四",99,89));
        stu.add(new Students("王五",89,99));
        stu.add(new Students("赵六",98,100));

        Iterator<Students> iterator = stu.iterator();

        while (iterator.hasNext()){
            System.out.println(iterator.next());

        }

    }
}
